<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="autor" content="Breezy New Media (info@breezy.cz)" />
<meta name="copyright" content="PointSpace - free website layout 2008" />
<meta name="description" content=""  />
<meta name="keywords" content="" />
<title>Advanced Databases TUE - Search Track</title>
<link rel="stylesheet" type="text/css" href="./css/default.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./css/print.css" media="print" />
</head>
<f:view>
<body>

<div id="view">
  <div id="head">
    <div id="logo">
      <a href="" class="block">&nbsp;</a>
      <h1><a href="index.html">advanced<span>Databases</span></a></h1>
      <h2><a href="index.html">the music you are looking for..!</a></h2>
    </div>
    <hr class="hidden" />
    
    <jsp:include page="userMenu.jsp"/>
    
    <hr class="hidden" />
  </div>
  
  <div id="content">
    <div id="contentBlock" style="height:100%;">
      <div class="item last">
      </div>
      <div class="col1" style="width:600px;height:100%">
        <div class="item">
          <h3>Track Search</h3>
			<h:form>
				<table>
					<tr>
						<td>
							<h:inputText styleClass="button" size="60" value="#{trackSearchEngineBean.trackToSearch}"></h:inputText>
						</td>
					</tr>
					<tr>
						<td>
							<h:commandButton styleClass="submit" action="#{trackSearchEngineBean.searchTracks}" value="Search"></h:commandButton>
						</td>
					</tr>
				</table>
			</h:form>
        </div>
        <div class="item last">
			<div>
				<h:form>
					<t:dataTable newspaperColumns="2" newspaperOrientation="horizontal" style="border-width:0" value="#{trackSearchEngineBean.tracks}" var="item">
						<h:column>
							<table style="padding:0">
								<tr>
									<td style="width:450px">
										<h:commandLink action="trackInfo" style="display:block" value="#{item.name}">
											<f:param name="trackKey" value="#{item.id}"></f:param>
										</h:commandLink>
									</td>
									<td>
										<h:commandLink  onclick="doPlay(\"#{item.url}\",\"#{item.name}\"); javascript:EP_play(\"ep_player\"); return false;">
											<h:graphicImage style="margin:0px;vertical-align:bottom"  value="images/ico/play.png"></h:graphicImage>
										</h:commandLink>									
									</td>
								</tr>
								<tr>
									<td>
										<b><h:outputText style="display:block" value="#{item.artistId}"/></b>
										<f:subview id="admin" rendered="#{loginManagerBean.isAdmin}">
											<h:commandLink styleClass="remove" title="Edit" action="#{trackSearchEngineBean.editTrack}">
												<h:graphicImage style="margin:0px;vertical-align:bottom;"  value="images/ico/edit.png"></h:graphicImage>							
												<f:param name="trackKey" value="#{item.id}"></f:param>
												<f:param name="albumKey" value="#{item.albumId}"></f:param>
												<f:param name="artistKey" value="#{item.artistId}"></f:param>
											</h:commandLink>
										</f:subview>
										<f:subview id="admin1" rendered="#{loginManagerBean.isAdmin}">
											<h:commandLink styleClass="edit" title="Remove" action="#{trackSearchEngineBean.removeTrack}">												
												<h:graphicImage style="padding-left:2px;margin:0px;vertical-align:bottom;"  value="images/ico/delete.png"></h:graphicImage>
												<f:param name="trackKey" value="#{item.id}"></f:param>
											</h:commandLink>
										</f:subview>
									</td>
								</tr>							
							</table>						
						</h:column>
					</t:dataTable>	
				</h:form>
			</div>            
        </div>
      </div>
      <!-- /#cols 50:50 -->
      
    </div>
    <hr class="hidden" />
        <div id="menuBlock">
      <div class="box boxText">
      	<h3>RSS Feeds</h3>
          	<div style="position:relative">
          		<a title="RSS Feed" href="http://localhost:8080/exist/ad/rssTopRatedTracks.xql"><img src="images/ico/rss16x16.png"></a><strong> Top Rated Tracks</strong>
          	</div>	      
        	<br/>       
        <h3>Top Tracks</h3>
      </div>
    </div>
  </div>
  
  
  
  <hr class="hidden" />
  <ul class="hidden">
    <li><a href="#view"></a></li>
    <li><a href="#content"></a></li>
  </ul>
  <hr class="hidden" />
  
  <div id="foot">
    <p class="fl">&copy; all rights reserved</p>
    
    
    
    <!-- /#   LINKS AND AUTHOR-SIGNATURE CANNOT BE REMOVED !!! -->
    <p class="fr"><a href="www.tue.nl" title="See more ON">TUE</a> created by <a href="http://www.tue.nl" class="ico ico-breezy">TUE</a></p>
  </div>
</div>

</body>
</f:view>
</html>
